<!--<template>-->
<!--  <BasicModal-->
<!--    v-bind="$attrs"-->
<!--    @register="registerCategory"-->
<!--    :title="title"-->
<!--    @visible-change="handleVisibleChange"-->
<!--    @ok="modalEdit"-->
<!--  >-->
<!--    <div class="pt-3px pr-3px">-->
<!--      <Input size="large" v-model:value="model" placeholder="请输入类目名称" />-->
<!--    </div>-->
<!--  </BasicModal>-->
<!--</template>-->
<!--<script lang="ts">-->
<!--  import { defineComponent, ref, nextTick, unref } from 'vue';-->
<!--  import { BasicModal, useModalInner } from '/@/components/Modal';-->
<!--  import { Input } from 'ant-design-vue';-->
<!--  // import { saveCategoryList, updateCategoryList } from '/@/api/sys/category';-->
<!--  import { useMessage } from '/@/hooks/web/useMessage';-->

<!--  export default defineComponent({-->
<!--    components: { BasicModal, Input },-->
<!--    props: {-->
<!--      userData: { type: Object },-->
<!--    },-->
<!--    emits: ['success'],-->
<!--    setup(props, { emit }) {-->
<!--      const { createMessage } = useMessage();-->
<!--      const modelRef = ref<string>('');-->
<!--      const titleText = ref<string>();-->
<!--      const grade = ref<number>(0);-->
<!--      const sysno = ref<number>(0);-->
<!--      const type = ref<number>(0);-->
<!--      const isUpdate = ref(true);-->

<!--      const [registerCategory, { closeModal }] = useModalInner((data) => {-->
<!--        data && onDataReceive(data);-->
<!--      });-->

<!--      function onDataReceive(data) {-->
<!--        console.log('Data Received', data);-->
<!--        modelRef.value = data.name;-->
<!--        titleText.value = data.title;-->
<!--        grade.value = data.grade;-->
<!--        sysno.value = data.sysno;-->
<!--        type.value = data.type;-->
<!--        isUpdate.value = !!data?.isUpdate;-->
<!--      }-->

<!--      async function modalEdit() {-->
<!--        if (!modelRef.value) {-->
<!--          createMessage.error('请填写类目名称');-->
<!--          return;-->
<!--        }-->
<!--        if (type.value === 1) {-->
<!--          await saveCategoryList({-->
<!--            grade: grade.value,-->
<!--            parentSysno: sysno.value,-->
<!--            name: modelRef.value,-->
<!--          });-->
<!--          closeModal();-->
<!--          emit('success', { isUpdate: unref(isUpdate) });-->
<!--        } else {-->
<!--          await updateCategoryList({-->
<!--            sysNo: sysno.value,-->
<!--            name: modelRef.value,-->
<!--          });-->
<!--          closeModal();-->
<!--          emit('success', { isUpdate: unref(isUpdate) });-->
<!--        }-->
<!--      }-->

<!--      function handleVisibleChange(v) {-->
<!--        v && props.userData && nextTick(() => onDataReceive(props.userData?.update));-->
<!--      }-->

<!--      return {-->
<!--        registerCategory,-->
<!--        title: titleText,-->
<!--        model: modelRef,-->
<!--        handleVisibleChange,-->
<!--        modalEdit,-->
<!--        closeModal,-->
<!--      };-->
<!--    },-->
<!--  });-->
<!--</script>-->
